#pragma once
#include <map>
#include <vector>
#include "source/input/InputSource.h"
#include "source/output/OutputSource.h"
#include "mixer/VideoScenesInItem.h"
#include "mixer/AudioScenesInItem.h"
#include "mixer/VideoScenesOutItem.h"
#include "mixer/AudioScenesOutItem.h"

#include "SqlTableOp.h"
namespace Media{
    const std::map<std::string, SourceInterfaceEnum> SourceInterConnectMap = {
        {HDMI_TYPE, HDMI},
        {USBA_TYPE, USB_TYPEA},
        {USBC_TYPE, USB_TYPEC},
        {LINEIN_TYPE, LINE_IN},
        {LINEOUT_TYPE, LINE_OUT},
        {BLUETOOTH_TYPE, BLUETOOTH},
        {NETWORK_TYPE, NETWORK},
        {AIRPLAY_TYPE, AIRPLAY},
        {QUICKSHARE_TYPE, QUICKSHARE},
        {LOCAL_FILE_TYPE, LOCAL_FILE},
    };
    
    bool toScenesInItemConfig(const scenesTable& sc, std::map<uint32_t,VideoScenesInItemConfig>& vMap,
        std::map<uint32_t, AudioScenesInItemConfig>& aMap);
    
    bool toVideoScenesOutItemConfig(const scenesTable& sc, VideoScenesOutItemConfig& outConfig, std::vector<uint32_t>& sources);
    bool toAudioScenesOutItemConfig(const scenesTable& sc, AudioScenesOutItemConfig& outConfig, std::vector<uint32_t>& sources);

    bool toVideoItemTable(const VideoScenesInItemConfig& config, scenesItemTable& tb);
    bool toAudioItemTable(const AudioScenesInItemConfig& config, scenesItemTable& tb);

    bool toVideoOutTableString(const VideoScenesOutItemConfig& outConfig, std::string& tableStr);
    bool toAudioOutTableString(const AudioScenesOutItemConfig& outConfig, std::string& tableStr);

    bool toAddOutSourceTableString(uint32_t sourceId, std::string& tableStr);
    bool toRemoveOutSourceTableString(uint32_t sourceId, std::string& tableStr);

}